<?php

class Empeval_Methods_Request_LoginAuto {
	
	/**
	 *
	 * @var App_Methods_Data_App
	 */
	public $app;
	public $login;
	public $domain;
	
	public function __construct($params) {
		$this->app = new App_Methods_Data_App($params->app);
		$this->login = $params->login;
		$this->domain = $params->domain;
	}
	
	public function process() {
		$authResult = Empeval_Auth::getInstance()
		->setLoginData(new Empeval_AuthData_ADAuto($this->login, $this->domain))
		->authenticate();
    if ($authResult->isValid())
    	return new Empeval_Methods_Response_Login(true);
    
    return new Empeval_Methods_Response_Login(false);
	}
	
}